<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="box1" style="position:absolute;">
        <div class="box2" style="position:fixed;">
            <div class="box3"></div>
        </div>
    </div>
    <script type="text/javascript">
        var box3 = document.getElementsByClassName("box3")[0];
        console.log(box3.offsetParent);
    </script>
</body>

</html>